export default {
    namespaced: true,
    state: {
        bg:new Audio(require('@/assets/audio/待机中.mp3')),
        gameBg:new Audio(require('@/assets/audio/扫雷开始.mp3')),
        clickBg:new Audio(require('@/assets/audio/点击音效.mp3')),
    },
    mutations: {
        beginBg(state){
            state.bg.loop = true;
            state.bg.play();
        },
        endBg(state){
            state.bg.pause();
            state.bg.currentTime = 0;
        },
        beginGameBg(state){
            state.gameBg.loop = true;
            state.gameBg.play();
        },
        endGameBg(state){
            state.gameBg.pause();
            state.gameBg.currentTime = 0;
        },
        beginClickBg(state){
            state.clickBg.play();
        },
    }
}